<?php

// +----------------------------------------------------------------------
// | ThinkAdmin
// +----------------------------------------------------------------------
// | 版权所有 2014~2019 广州楚才信息科技有限公司 [ http://www.cuci.cc ]
// +----------------------------------------------------------------------
// | 官方网站: http://demo.thinkadmin.top
// +----------------------------------------------------------------------
// | 开源协议 ( https://mit-license.org )
// +----------------------------------------------------------------------
// | gitee 代码仓库：https://gitee.com/zoujingli/ThinkAdmin
// | github 代码仓库：https://github.com/zoujingli/ThinkAdmin
// +----------------------------------------------------------------------

// 注册系统指令
// use think\Console;

// Console::addDefaultCommands([
//    'app\company\command\Subversion',
// ]);
use think\Db;

function getDays($name , $leixing , $date1 , $date2)
{
	$sql ="select sum(days) as day1 from  users_jiaqi
	where name='".$name."' 
	and leixing='".$leixing."' 
	and startdate >='".$date1."' 
	and startdate<='".$date2."'";
	$sum = Db::query($sql);
	if( $sum['0']['day1'] =='' ) {

		$sum ='';
		return $sum;
	}
	return $sum['0']['day1'];
}